package com.example.CarManagement.sys.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.example.CarManagement.enumPojo.DriverStatus;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 司机信息表，存储所有司机的专业信息和当前状态
 * </p>
 *
 * @author 徐佳彪
 * @since 2025-07-17
 */
@TableName("c_drivers")
public class Drivers implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 司机ID，（工号）
     */
    private String driverId;

    /**
     * 司机这个角色ID
     */
    private String driverRoleId;

    /**
     * 关联的用户ID，关联users表，唯一
     */
    private String userId;

    /**
     * 驾驶证号码，唯一
     */
    private String driverLicense;

    /**
     * 驾驶证类型，如C1、A2等
     */
    private String licenseType;

    /**
     * 驾驶证到期日
     */
    private LocalDate licenseExpiry;

    /**
     * 驾龄(年)
     */
    private Integer drivingExperience;

    /**
     * 司机评分，1.0-5.0
     */
    private BigDecimal rating;

    /**
     * 司机状态：available-可用，on_duty-出勤中，off_duty-下班，on_leave-休假
     */
    private DriverStatus status;

    /**
     * 当前驾驶车辆ID，关联vehicles表
     */
    private String currentVehicleId;

    /**
     * 司机备注信息
     */
    private String notes;

    /**
     * 记录创建时间
     */
    private LocalDateTime createdAt;



    /**
     * 记录最后更新时间
     */
    private LocalDateTime updatedAt;

    /**
     * 是否删除（0:未删除，1:已删除）
     */
    private Boolean deleted;

    public String getDriverId() {
        return driverId;
    }

    public void setDriverId(String driverId) {
        this.driverId = driverId;
    }

    public String getDriverRoleId() {
        return driverRoleId;
    }

    public void setDriverRoleId(String driverRoleId) {
        this.driverRoleId = driverRoleId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getDriverLicense() {
        return driverLicense;
    }

    public void setDriverLicense(String driverLicense) {
        this.driverLicense = driverLicense;
    }

    public String getLicenseType() {
        return licenseType;
    }

    public void setLicenseType(String licenseType) {
        this.licenseType = licenseType;
    }

    public LocalDate getLicenseExpiry() {
        return licenseExpiry;
    }

    public void setLicenseExpiry(LocalDate licenseExpiry) {
        this.licenseExpiry = licenseExpiry;
    }

    public Integer getDrivingExperience() {
        return drivingExperience;
    }

    public void setDrivingExperience(Integer drivingExperience) {
        this.drivingExperience = drivingExperience;
    }

    public BigDecimal getRating() {
        return rating;
    }

    public void setRating(BigDecimal rating) {
        this.rating = rating;
    }

    public DriverStatus getStatus() {
        return status;
    }

    public void setStatus(DriverStatus status) {
        this.status = status;
    }

    public String getCurrentVehicleId() {
        return currentVehicleId;
    }

    public void setCurrentVehicleId(String currentVehicleId) {
        this.currentVehicleId = currentVehicleId;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return "Drivers{" +
            "driverId = " + driverId +
            ", driverRoleId = " + driverRoleId +
            ", userId = " + userId +
            ", driverLicense = " + driverLicense +
            ", licenseType = " + licenseType +
            ", licenseExpiry = " + licenseExpiry +
            ", drivingExperience = " + drivingExperience +
            ", rating = " + rating +
            ", status = " + status +
            ", currentVehicleId = " + currentVehicleId +
            ", notes = " + notes +
            ", createdAt = " + createdAt +
            ", updatedAt = " + updatedAt +
            ", deleted = " + deleted +
        "}";
    }
}
